function [model, modelcreated] = fsetupCOMSOL(modelName, modelPath)
    import com.comsol.model.*
    import com.comsol.model.util.*
    try 
        model = ModelUtil.create(modelName);
        model.modelPath(modelPath); 
        model.component.create('comp1', true);
        model.component('comp1').geom.create('geom1', 2);
        model.component('comp1').mesh.create('mesh1');
        model.component('comp1').physics.create('ec', 'ConductiveMedia', 'geom1');
        model.study.create('std1');
        model.study('std1').create('stat', 'Stationary');
        model.study('std1').feature('stat').setSolveFor('/physics/ec', true);
        modelcreated = 1;
    catch
        warning("Model creation error, model already created or try a different model name")
        modelcreated = 0;
    end
end

